package Donnees;

import java.util.HashMap;

public class Statistique {
	private int tpsReponseTotal;
	private int nbReponses;
	private float distanceTotale;
	
	public Statistique(){
		reset();
	}
	
	public void calculer(){
		
	}
	
	public void reset(){
		tpsReponseTotal = 0;
		nbReponses = 0;
		distanceTotale = 0;
	}
	
	public void addReponse(int temps) {
		nbReponses++;
		tpsReponseTotal += temps;
	}
	
	public void addDistance(double l){
		distanceTotale += l;
	}
	
	public HashMap<String, Float> getStats(){
		HashMap<String, Float> map = new HashMap<String, Float>();
		float moyenne = 0;
		if(nbReponses > 0)
			moyenne = (float)(tpsReponseTotal / nbReponses);
		map.put("TpsReponse", moyenne);
		map.put("DistTotale", distanceTotale);
		return map;
	}
}
